A dynamic host configuration protocol (DHCP) for Internet Protocol version 6 (IPv6) (DHCPv6) network system includes a DHCPv6 client, a DHCPv6 server, and a DHCPv6 relay agent, where the DHCPv6 relay agent may further be classified into two large categories: DHCPv6 layer-3 relay agent and DHCPv6 layer-2 relay agent. In the network, the DHCPv6 layer-3 relay agent is located between the DHCPv6 client and the DHCPv6 server, and relays and forwards messages between the DHCPv6 client and the DHCPv6 server.
According to a request for comments (RFC) 3315, the DHCPv6 layer-3 relay agent reconstructs a relay-forward message when performing layer-3 relay processing for an upstream DHCPv6 message, and encapsulates the original upstream DHCPv6 message into the relay-forward message for forwarding to the DHCPv6 server. After receiving the relay-forward message forwarded by the DHCPv6 layer-3 relay agent, the DHCPv6 server constructs a relay-reply message and encapsulates the message sent to the DHCPv6 client into the relay-reply message layer by layer, and sends the encapsulated message to the DHCPv6 layer-3 relay agent. The DHCPv6 layer-3 relay agent extracts a new downstream DHCPv6 message from the relay-reply message when performing layer-3 relay processing for the relay-reply message, and forwards the DHCPv6 message to a lower-level device according to a peer address field, a link address field, and an interface identifier option (interface-ID option) field in the relay-reply message. The peer-address is an IPv6 address of the lower-level device connected to the DHCPv6 layer-3 relay agent, the link-address is an IPv6 address of a layer-3 interface for connecting the DHCPv6 layer-3 relay agent to the lower-level device, and the interface-ID option is an ID of a user port for connecting the DHCPv6 layer-3 relay agent to the lower-level device. As provided by the protocol, only a global unicast address or a site-local address can be filled in the link-address filed. If the layer-3 interface is not configured with any global unicast address or site-local address, only an unspecified address (::) can be filled in the link-address, and the interface-ID option is used to carry ID information of the user port.
When the lower-level device uses a link-local address and the layer-3 interface for connecting the DHCPv6 layer-3 relay agent to the lower-level device also uses a link-local address, in the relay-reply message, the peer-address is a link-local address and the link-address is an unspecified address. In this case, the DHCPv6 layer-3 relay agent needs to send the downstream DHCPv6 message to the lower-level device according to the user port identified by the interface-ID option. The user port is a physical port on the layer-3 relay agent device, and a manner of using the physical port is configuring it as a layer-3 interface and receiving and sending a layer-3 message using a configured IPv6 address. However, the user port of the DHCPv6 layer-3 relay agent generally does not correspond to the layer-3 interface on a one-to-one basis. For example, in a triple-play scenario, multiple service streams need to be configured on a user port of the DHCPv6 layer-3 relay agent. The service streams are used to separately bear different services of a same user, and a virtual local area network (VLAN) bears a same service on different user ports. Each VLAN is configured with a layer-3 interface, that is, the user port and the VLAN or the layer-3 interface are in a many-to-many relationship. In this case, the DHCPv6 layer-3 relay agent can find only a unique user port according to the interface-ID option, but cannot find a unique layer-3 interface, and therefore cannot send the downstream DHCPv6 message to the lower-level device through a correct layer-3 interface.
To forward the DHCPv6 message to the lower-level device correctly, there exists the following solutions in the prior art. One solution is configuring a global unicast address or a site-local address for the lower-level device according to RFC 3315 such that the DHCPv6 layer-3 relay agent may query a routing table using the peer-address to find the layer-3 interface, and send the downstream DHCPv6 message to the lower-level device through a correct layer-3 interface. Another solution is configuring, according to RFC 3315, a global unicast address or a site-local address for the layer-3 interface for connecting the DHCPv6 layer-3 relay agent to the lower-level device such that the DHCPv6 layer-3 relay agent may use the link-address to find the layer-3 interface, and send the downstream DHCPv6 message to the lower-level device through a correct layer-3 interface. Still another solution is configuring a layer-3 interface for each user port of the DHCPv6 layer-3 relay agent according to RFC 3315 to make the user port correspond to the layer-3 interface on a one-to-one basis such that the layer-3 relay agent may first use the interface-ID option to find a unique user port, and then find a unique corresponding layer-3 interface according to the user port, and send the downstream DHCPv6 message to the lower-level device through a correct layer-3 interface.
In a process of implementing the present disclosure, the inventor finds that the prior art has at least the following problems. No matter a global unicast address or a site-local address is configured for the lower-level device, or for the layer-3 interface of the DHCPv6 layer-3 relay agent, the planning and configuration workload of the global unicast address or a site-local address is increased, and resources of global unicast addresses or site-local addresses are wasted. The solution of configuring a layer-3 interface for each user port increases the number of layer-3 interfaces on the DHCPv6 layer-3 relay agent, which greatly increases the workload of layer-3 forwarding of the DHCPv6 layer-3 relay agent, reduces layer-3 forwarding performance, and wastes IPv6 address resources.